package org.springframework.prospring.ticket.web.controllers;

import org.springframework.web.servlet.mvc.Controller;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * User: Juan Cabrera
 * Date: 12/02/2009
 * Time: 15:30:37
 * To change this template use File | Settings | File Templates.
 */
public class HomeController implements Controller {
    public ModelAndView handleRequest(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {

        System.out.println("==== ====== === ===  ======= HomeController - alexis 03");
        String aMessage = "This is a HOME MVC!";

        ModelAndView modelAndView = new ModelAndView("homeViewName");
        modelAndView.addObject("message", aMessage);

        return modelAndView;
    }
}
